#ifndef TELEMETRYDIALOG_H
#define TELEMETRYDIALOG_H

#include <QDialog>
#include <QTimer>
#include <QWidget>

namespace Ui {
class TelemetryForm;
}

class TelemetryDialog : public QDialog
{
    Q_OBJECT

public:
    explicit TelemetryDialog(QWidget *parent = nullptr);
    ~TelemetryDialog();

private slots:
    void on_time_slider_valueChanged(int value);

    void on_telemetry_btn_clicked();

    void on_progressBar_valueChanged(int value);
    void onTimer();
    void onTelemetryResult(QString str);

    void on_copy_btn_clicked();
    void on_close_btn_clicked();

protected:
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void scaleWidgets(QWidget *widget, double xScale,double yScale);

private:
    Ui::TelemetryForm *ui;
    QTimer m_timer;
    bool m_bPressed;
    QPoint m_dragStartPos;   // 鼠标按下时的位置
    QPoint m_StartPos; // 按钮初始位置


    // QWidget interface
protected:
    void showEvent(QShowEvent *event);
    void hideEvent(QHideEvent *event);
};

#endif // TELEMETRYDIALOG_H
